var Vue = require('vue');

//Vue网络请求插件
Vue.use(require('vue-resource'));
Vue.http.options.emulateJSON = true;
Vue.http.options.emulateHTTP = true;

//Vue触摸事件插件
var VueTouch = require('vue-touch');
Vue.use(VueTouch);


//Vue状态管理插件
var Vuex = require('vuex');
Vue.use(Vuex);
var store = require("../libs/js/vuex/store.js");

//Vue路由插件
var VueRouter = require('vue-router');
Vue.use(VueRouter);

//图片查看插件
var VuePreview = require('../components/preview/index.js');
Vue.use(VuePreview)

var pullLoad = require('../plugins/vuePullLoading/pullLoad.js')
Vue.use(pullLoad);
//Vue图片懒加载插件
require('vue-img-lazyload');
Vue.use(Vue.lazyimg, {
	nofadein: false,
	nohori: false
})

//加载框架样式
require("../libs/css/mainFrame.scss");

//配置路由
var appRouter = new VueRouter();
var routeConfig = require("./routeConfig.js");
appRouter.map(routeConfig);
appRouter.redirect({
	'*': "/index" //重定向任意未匹配路径到/main
});

//加载网络配置
window.HQ_NETWORK = require("networkConfig");

//创建API callback对象
window.HQ_CALLBACK = {};

//框架主文件
var mainFrame = require('../src/mainFrame.vue');

//框架配置
var App = {
	components: {
		app: mainFrame
	},
	store: store
};
//启动应用
appRouter.start(App, 'body');